﻿Imports System.ComponentModel

Public Class CLDS_Type_Prop_Converter
    Inherits StringConverter
    Private Shared _TypeList As Collection
    Private Shared _PSList As Collection
    Public Shared Property TypeList() As Collection
        Get
            Return _TypeList
        End Get
        Set(ByVal value As Collection)
            _TypeList = value
        End Set
    End Property
    Public Shared Property PSList() As Collection
        Get
            Return _PSList
        End Get
        Set(ByVal value As Collection)
            _PSList = value
        End Set
    End Property
    Public Overloads Overrides Function GetStandardValuesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
        Return True
    End Function
    Public Overloads Overrides Function GetStandardValuesExclusive(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
        Return True
    End Function
    Public Overloads Overrides Function GetStandardValues(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.ComponentModel.TypeConverter.StandardValuesCollection
        Dim csp As CLDS_Segment_Properties = DirectCast(context.Instance, CLDS_Segment_Properties)
        If csp.Tag = "PS" Then
            Return New StandardValuesCollection(_PSList)
        Else
            Return New StandardValuesCollection(_TypeList)
        End If
    End Function
End Class